﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="FileEditRequestResult.cs" company="Sander van Vliet">
//   2011 Sander van Vliet
// </copyright>
// <summary>
//   The file edit request result.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace TFDP.Common
{
    using System.Collections.Generic;

    /// <summary>
    /// The file edit request result.
    /// </summary>
    public sealed class FileEditRequestResult
    {
        #region Constants and Fields

        /// <summary>
        /// The data.
        /// </summary>
        private Dictionary<string, object> data;

        /// <summary>
        /// The message.
        /// </summary>
        private string message;

        /// <summary>
        /// The success.
        /// </summary>
        private bool success;

        #endregion

        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="FileEditRequestResult"/> class.
        /// </summary>
        /// <param name="success">
        /// The success.
        /// </param>
        /// <param name="message">
        /// The message.
        /// </param>
        public FileEditRequestResult(bool success, string message)
        {
            this.success = success;
            this.message = message;
            this.data = new Dictionary<string, object>();
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets Empty.
        /// </summary>
        public static FileEditRequestResult Empty
        {
            get
            {
                return new FileEditRequestResult(false, string.Empty);
            }
        }

        /// <summary>
        /// Gets Data.
        /// </summary>
        public Dictionary<string, object> Data
        {
            get
            {
                return this.data;
            }
        }

        /// <summary>
        /// Gets or sets Message.
        /// </summary>
        public string Message
        {
            get
            {
                return this.message;
            }

            set
            {
                if (string.Equals(this.message, value))
                {
                    this.message = value;
                }
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether Success.
        /// </summary>
        public bool Success
        {
            get
            {
                return this.success;
            }

            set
            {
                if (this.success != value)
                {
                    this.success = value;
                }
            }
        }

        #endregion
    }
}